import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/address-segment',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
  },
  {
    path:'/address-segment',
    name:'地址分词',
    component:() => import('../views/addressSegment'),
    children:[
      {
        path:'detail/:id',
        name:'详情',
        component:() => import('../views/addressSegment/taskDetail.vue')
      }
    ]
  },
  {
    path: '/quality-test-task',
    name: '质检任务',
    component: () => import('../views/qualityTest/task/index.vue'),
    children: [
      {
        path:'detail/:id',
        name:'详情',
        component:() => import('../views/qualityTest/task/detail.vue')
      }
    ]
  },
  {
    path: '/one-code-access',
    name: '一码多址任务管理',
    component:()=>import('@/views/oneCodeAccess/task/index.vue')
  },
  {
    path: '/one-code-access/detail/:id',
    name: '一码多址任务详情',
    component:()=>import('@/views/oneCodeAccess/task/detail.vue')
  },
  {
    path: '/one-code-access/unify/:id',
    name: '统一编码详情',
    component:()=>import('@/views/oneCodeAccess/task/unify.vue')
  },
  {
    path: '/code-address',
    name: '统一地址管理',
    component:()=>import('@/views/oneCodeAccess/codeAddress/codeAddress.vue')
  },
  {
    path: '/save-address',
    name: '存量地址管理',
    component:()=>import('@/views/oneCodeAccess/saveAddress.vue')
  },
  {
    path: '/quality-test-rule',
    name: '质检规则',
    component:()=>import('../views/qualityTest/rule/index.vue')
  },
  {
    path: '/quality-test-problem',
    name: '问题地址',
    component:()=>import('../views/qualityTest/problem/index.vue')
  },
  {
    path: '/data-assembly',
    name: '入块数据组装',
    component:()=>import('../views/dataAssembly')
  },
  {
    path:'/api-layout',
    name:'api编排',
    component:() => import('../views/apiLayout')
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
